package com.nuoniu.sibanyun.mapper.so;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.so.VSaleDeliveryMain;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * <p>
 * 销售发货单主表 Mapper 接口
 * </p>
 *
 * @author 小啊刚
 * @since 2020-12-07
 */
@Component
@Mapper
public interface VSaleDeliveryMainMapper extends BaseMapper<VSaleDeliveryMain> {

    @Select("select voucher_code from scs_delivery where date_format(create_date, #{dateStr})=date_format(now(), #{dateStr}) and company_id=#{companyId} order by id desc limit 1")
    String getCode(Integer companyId, String dateStr);
}
